<?php


/**
 * This class defines the structure of the 'player' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    orm.map
 */
class PlayerTableMap extends TableMap {

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'orm.map.PlayerTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
	  // attributes
		$this->setName('player');
		$this->setPhpName('Player');
		$this->setClassname('Player');
		$this->setPackage('orm');
		$this->setUseIdGenerator(true);
		// columns
		$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, 11, null);
		$this->addColumn('NAME', 'Name', 'VARCHAR', false, 150, null);
		$this->addColumn('FIRST_NAME', 'FirstName', 'VARCHAR', false, 50, null);
		$this->addColumn('LAST_NAME', 'LastName', 'VARCHAR', false, 50, null);
		$this->addColumn('BATTING_STYLE', 'BattingStyle', 'VARCHAR', false, 255, null);
		$this->addColumn('BOWLING_STYLE', 'BowlingStyle', 'VARCHAR', false, 255, null);
		$this->addColumn('IS_ALLROUNDER', 'IsAllrounder', 'CHAR', false, 1, 'N');
		$this->addColumn('BASE_VALUE', 'BaseValue', 'INTEGER', false, 10, null);
		$this->addColumn('POINT', 'Point', 'INTEGER', false, 10, null);
		$this->addColumn('CURRENT_VALUE', 'CurrentValue', 'INTEGER', false, 10, null);
		$this->addColumn('IS_FEATURED', 'IsFeatured', 'CHAR', false, 1, 'N');
		$this->addColumn('IS_ACTIVE', 'IsActive', 'CHAR', false, 1, 'Y');
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
    $this->addRelation('RecordBook', 'RecordBook', RelationMap::ONE_TO_MANY, array('id' => 'player_id', ), null, null);
    $this->addRelation('PlayerToTeam', 'PlayerToTeam', RelationMap::ONE_TO_MANY, array('id' => 'player_id', ), null, null);
    $this->addRelation('UserTeamPlayer', 'UserTeamPlayer', RelationMap::ONE_TO_MANY, array('id' => 'player_id', ), null, null);
    $this->addRelation('DailyRecord', 'DailyRecord', RelationMap::ONE_TO_MANY, array('id' => 'player_id', ), null, null);
    $this->addRelation('UserTeamPlayerHistory', 'UserTeamPlayerHistory', RelationMap::ONE_TO_MANY, array('id' => 'player_id', ), null, null);
	} // buildRelations()

} // PlayerTableMap
